#include "prec.h"
#include "exception.h"

wxDException::wxDException( int errorCode )
	: mErrorCode(errorCode)
	, mErrorMessage(ErrorCodeAsString(errorCode))
{

}

wxDException::wxDException( int errorCode, const wxString& errorMessage )
	: mErrorCode(errorCode)
	, mErrorMessage(errorMessage)
{

}

wxDException::wxDException( const wxDException& e )
	: mErrorCode(e.mErrorCode)
	, mErrorMessage(e.mErrorMessage)
{

}

wxDException::~wxDException()
{

}

const wxString wxDException::ErrorCodeAsString( int errorCode )
{
	switch (errorCode)
	{
	case InternalError:
		return wxT("Internal error");
	case DuplicateItem:
		return wxT("Duplicate item");
	case IncorrectParametric:
		return wxT("Incorrect parametric");
	case InvalidCalling:
		return wxT("Invalid calling");
	default:
		return wxT("Unknown error");
	}
}
